#ifndef _IUIBASE_H_
#define _IUIBASE_H_

typedef struct TagNotifyEvent {
	UINT	type;
	ULONG	tm;
	UINT	id;
	UINT	event;
	UINT	state;
	UINT	message;
	POINT	pt;
	LPARAM	lParam;
	WPARAM	wParam;
	void*	Window;
} NotifyEvent;

enum UIType
{
	UI_NONE = 0,
	UI_MESSAGELOOP,
	UI_WINDOWS,
	UI_BUTTON,
};

#define	IS_UI_MESSAGELOOP(CLS) \
	((UIType)(CLS) == UI_MESSAGELOOP)

#define	IS_UI_WINDOWS(CLS) \
	((UIType)(CLS) == UI_WINDOWS)

#define	IS_UI_BUTTON(CLS)	\
	((UIType)(CLS) == UI_BUTTON)

#include <ui/iuicontrol.h>
#include <ui/iuiwindow.h>

interface IUIMessageLoop : public IBase
{
	std_method(Add)(IUIWindow* pBase) PURE;
	std_method(Del)(IUIWindow* pBase) PURE;
	std_method_(int, MessageLoop)() PURE;
};

// {EE9DDD66-0242-460D-9C41-2B3802022780}
_DEFINE_IID(IID_IUIMessageLoop,
	0xee9ddd66, 0x242, 0x460d, 0x9c, 0x41, 0x2b, 0x38, 0x2, 0x2, 0x27, 0x80);

interface IUIBase : public IBase
{
	std_method(CreateControl)(UIType type, IBase **pControl) PURE;
};

// {C00A606D-314B-40D6-9EDC-BE3DDFB91F2A}
_DEFINE_IID(IID_IUIBase,
	0xc00a606d, 0x314b, 0x40d6, 0x9e, 0xdc, 0xbe, 0x3d, 0xdf, 0xb9, 0x1f, 0x2a);

// {CE065148-7803-45B1-B1D7-874B52B8F5C5}
_DEFINE_GUID(CLSID_IUIbase,
	0xce065148, 0x7803, 0x45b1, 0xb1, 0xd7, 0x87, 0x4b, 0x52, 0xb8, 0xf5, 0xc5);

#endif // !_IUIBASE_H_
